﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GraphLibrary
{
    public interface IGraph<TVertex, TEdge>
        where TEdge : IEdge<TVertex>
    {
        IEnumerable<TVertex> Vertices
        {
            get;
        }

        IEnumerable<TEdge> IncidentEdges(TVertex vertex);

        IEnumerable<TVertex> AdjacentVertices(TVertex vertex);

        int CountOfVertices
        {
            get;
        }

        void AddVertex(TVertex vertex);

        void AddVertices(IEnumerable<TVertex> vertices);

        void AddEdge(TEdge edge);

        void AddEdges(IEnumerable<TEdge> edges);

        void RemoveVertex(TVertex vertex);

        void RemoveVertices(IEnumerable<TVertex> vertices);

        void RemoveEdge(TEdge edge);

        void RemoveEdge(TVertex source, TVertex destination);

        void RemoveEdges(IEnumerable<TEdge> edges);

        bool ContainsEdge(TEdge edge);

        bool ContainsEdge(TVertex source, TVertex destination);

        bool ContainsVertex(TVertex vertex);

        double[,] ToAgencyMatrix(Func<TEdge, double> weight);
    }
}
